<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
@include("layouts.common.head")
<!-- Fonts -->
    <link href="{{ asset('static/css/company/common.css') }}" rel="stylesheet">
    <link href="{{ asset('static/css/company/company_jobs.css') }}" rel="stylesheet">
    <!-- Styles -->
    <style>
        html {
            overflow-y: scroll;
        }
    </style>
</head>
<body>
<div id="app">
    @include("layouts.nav")
    @include("company.job.other_top_nav")
    <div class="user_main">
        <div class="mleft">
            @include('company.job.left')
        </div>
        <div class="mright">
            <div class="user_pagetitle">
                <div class="pat_l">管理职位</div>
                <div class="clear"></div>
            </div>
            <div class="user_tab mt15">
                <a href="{{url('company/job')}}" class="tabli @if($id ==0) select @endif">全部职位</a>
                <a href="{{url('company/job',[1])}}" class="tabli @if($id ==1) select @endif">发布中的职位</a>
                <a href="{{url('company/job',[2])}}" class="tabli @if($id ==2) select @endif">未显示的职位</a>
                <div class="clear"></div>


                <div class="btnbox">
                    <div class="btn_yellow J_hoverbut btn_add" >发布职位</div>
                </div>

            </div>
            {{--<div class="user_tip w880">--}}
            {{--<div class="tiptit">小提示</div>--}}
            {{--<div class="tiptxt link_blue">--}}
            {{--亲爱的HR，您的帐号可同时发布 {$setmeal.jobs_meanwhile} 个职位，现已发布 {$total} 个职位。--}}
            {{--</div>--}}
            {{--</div>--}}


            @if($job->first())
                <form id="form1" action="" class="J_allListBox" method="post">
                    <div class="jobsWrap">

                        @foreach($job as $key=>$item)
                            <div class="jobsList">
                                <div class="selWrap">

                                </div>
                                <div class="jobs fl">
                                    <div class="title">
                                        <a target="_blank" href="{{url('job/info',[$item->id])}}"
                                           class="">{{$item->jobs_name}}</a>
                                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                    </div>
                                    <div class="update">
                                        待处理简历：
                                        <a href="{{url('company/resume/1')}}?id={{$item->id}}"
                                           class="">{{$item->dispose_number}}</a>
                                        &nbsp;&nbsp; | &nbsp;&nbsp;更新时间：{{date('Y/m/d',$item->refresh_time)}}
                                    </div>
                                </div>
                                <div class="s-t-box m fl">

                                    <div class="status font_yellow">@if($item->display == 0)
                                            关闭中 @elseif($item->display == 1) 招聘中 @elseif($item->display==2)
                                            <div class="status font_red">已关闭</div>@endif</div>
                                    {{--<div class="status font_red" title="">审核未通过<div class="no_pass">--}}
                                    {{--<div class="des_box">--}}
                                    {{--<div class="desarrow"></div>--}}
                                    {{--<div class="des_txt">--}}
                                    {{----}}
                                    {{--</div>--}}
                                    {{--</div>--}}
                                    {{--</div>--}}
                                    {{--</div>--}}
                                </div>

                                <div class="edit link_blue fl">
                                    <a href="{{url('job/edit',[$item->id])}}" class="">修改</a>
                                    @if($item->display == 2)
                                        <a href="{{url('job/regain',[$item->id])}}" class="jobs_display" id="">恢复</a>
                                    @elseif($item->display == 1)
                                        <a href="{{url('job/delete',[$item->id])}}" class="delete" id="">关闭</a>
                                    @endif
                                </div>
                                <div class="clear"></div>
                            </div>
                        @endforeach

                        <div class="clear"></div>
                    </div>
                    <div class="jobsWrap">
                        {{--<div class="allSelWrap">--}}
                        {{--<input name="" class="allSel J_allSelected" type="checkbox">--}}
                        {{--</div>--}}
                        {{--<div class="btn_lightgray J_hoverbut btn_inline btn_border" id="delete_all">删除职位</div>--}}

                        {{ $job->links() }}

                        <div class="clear"></div>
                    </div>
                </form>
            @else
                <div class="jobsWrap">
                    <div class="res_empty">
                        亲爱的HR，您还没有发布职位<br>
                        想要快速找到合适的人才，就赶紧发布职位招揽人才吧~
                    </div>
                    <div class="res_empty_addbox">
                        <div class="btn_blue J_hoverbut btn_115_38 job_add">
                            发布职位>>
                        </div>
                    </div>
                </div>
            @endif


        </div>
        <div class="clear"></div>
    </div>
</div>
<script type="text/javascript" src="{{asset('static/js/area/Popt.js')}}"></script>
<script type="text/javascript" src="{{asset('static/js/area/cityJson.js')}}?v=<?php echo time()?>"></script>
<script type="text/javascript" src="{{asset('static/js/area/citySet.js')}}?v=<?php echo time()?>"></script>
<script type="text/javascript" src="{{asset('static/js/jquery.modal.dialog.js')}}"></script>
<script>
    $('.job_add,.btn_add').die().live('click', function () {
        // var href = $(this).attr('href');
        //先去请求看是否已经付费用户
        $.getJSON("{{url('company/pay')}}", function (result) {
            if (result.status == 1) {
                window.location.href = "{{url('job/edit')}}";
            } else {
                if (result.status == 2) {
                    $(this).dialog({
                        title: '签约提示',
                        content: result.data.html,
                        border: false,
                        yes: function () {
                            window.location.href = "{{url('company/info')}}";
                        }
                    });
                } else {
                    $(this).dialog({
                        title: '签约提示',
                        content: result.data.html,
                        border: false,
                    });
                }
            }
        });

    });

</script>
</body>
</html>
